from django.urls import path, include
from rest_framework import routers

from . import api
from . import views

router = routers.DefaultRouter()
router.register(r'news', api.newsViewSet)


urlpatterns = (
    # urls for Django Rest Framework API
    path('api/v1/', include(router.urls)),
)

urlpatterns += (
    # urls for news
    path('news/', views.newsListView.as_view(), name='news_news_list'),
    path('news/create/', views.newsCreateView.as_view(), name='news_news_create'),
    path('news/detail/<int:pk>/', views.newsDetailView.as_view(), name='news_news_detail'),
    path('news/update/<int:pk>/', views.newsUpdateView.as_view(), name='news_news_update'),
)

